
const jwt = require('jsonwebtoken')
const {isTimestampExpired} = require("../../../utils/timestamp");
/**
 * author:wos
 * time:2024-1-4
 * title:获取服务端验证码（主要用于koa环境测试)
 */
async function version(ctx, next) {
    let sql = `select * from sys_user where token <> ''`
    let rs = await global.query(sql)
    let user = []
    for (let i in rs){
        const token = jwt.verify(rs[i].token, global.config.secret)
        if(token) user.push(rs[i])
    }
    global.response(ctx, {
        "status":200,
        "code": 200,
        "data": user,
        "msg":'success'
    })
}
module.exports = version


